<#cenluan title="${gallery.title}" menu="gallery" validate="true">
    <ol class="breadcrumb">
        <li><a href="/gallery">相册</a></li>
        <li class="active">详情</li>
    </ol>
    <div class="row">
        <div class="col-md-3 text-center">
            <img class="center-block img-rounded img-responsive mb20" src="${gallery.coverUrl}@!gallery-cover">

            <p><strong>相册名称：</strong>${gallery.title,xss}</p>

            <p><strong>创建人：</strong>${gallery.creater.html}</p>

            <p><strong>创建时间：</strong>${gallery.createTime,"yyyy-MM-dd HH:mm:ss"}</p>

            <div class="btn-group mb20">
                <a class="btn btn-default" href="/photo/${gallery.id}">
                    <span class="glyphicon glyphicon-picture"></span>&nbsp;查看照片
                </a>
                <!--@if(!isEmpty(session.user)&&!isEmpty(gallery.pwd)&&!creater&&!joined){-->
                <button class="btn btn-default" onclick="showDialog('/gallery/member/add/${gallery.id}')">
                    <span class="glyphicon glyphicon-plus"></span>&nbsp;加入相册
                </button>
                <!--@}-->
                <!--@if(creater||enabled){-->
                <a class="btn btn-default" href="/photo/add/${gallery.id}">
                    <span class="glyphicon glyphicon-upload"></span>&nbsp;上传照片
                </a>
                <!--@}-->
            </div>
            <!--@if(admin||creater){-->
            <div class="btn-group">
                <!--@if(creater){-->
                <a class="btn btn-default" href="/gallery/edit/${gallery.id}">
                    <span class="glyphicon glyphicon-edit"></span>&nbsp;编辑信息
                </a>
                <!--@}-->
                <button class="btn btn-danger" id="btn-delete">
                    <span class="glyphicon glyphicon-trash"></span>&nbsp;删除相册
                </button>
            </div>
            <script>
                $(function () {
                    $("#btn-delete").click(function () {
                        if (!confirm("确定要删除相册吗？")) {
                            return;
                        }
                        $.getJSON("/gallery/delete/${gallery.id}", function (json) {
                            if (json.ok) {
                                location = "/gallery";
                            } else {
                                alert(json.msg);
                            }
                        });
                    });
                });
            </script>
            <!--@}-->

        </div>
        <!-- col-md-3 -->
        <div class="col-md-9">
            <div class="callout callout-info">
                <h4>摘要</h4>

                <p>
                    创建于${gallery.createTime,prettyTime}，共有照片张${gallery.photoCount}张
                    <!--@if(!isEmpty(gallery.lastUpdateTime)){-->
                    ，最后一次上传照片于${gallery.lastUpdateTime,prettyTime}。
                    <!--@}-->
                </p>
            </div>
            <div class="callout callout-info">
                <h4>简介</h4>

                <p>${gallery.intro!"无简介内容",xss}</p>
            </div>
            <!--@if(memberList.~size>0){-->
            <div class="panel panel-default">
                <div class="panel-heading">目前有${memberList.~size}人参与</div>
                <div class="panel-body clearfix">
                    <!--@for(member in memberList){-->
                    <div class="pull-left p5">
                        <!--@if(admin||creater){-->
                        <a href="javascript:showDialog('/gallery/member/show/${member.id}');">
                            <img src="${member.user.avatarUrl}" class="avatar-md img-rounded"
                                 title="${member.user.nickname}">
                        </a>
                        <!--@}else{-->
                        <a href='/user/show/${member.userId}'>
                            <img src="${member.user.avatarUrl}" class="avatar-md img-rounded"
                                 title="${member.user.nickname}">
                        </a>
                        <!--@}-->
                    </div>
                    <!--@}-->
                </div>
            </div>
            <!--@}-->
            <!--@if((admin||creater)&&disabledMemberList.~size>0){-->
            <div class="panel panel-default">
                <div class="panel-heading">有${disabledMemberList.~size}人被封禁</div>
                <div class="panel-body clearfix">
                    <!--@for(member in disabledMemberList){-->
                    <div class="pull-left p5">
                        <a href="javascript:showDialog('/gallery/member/show/${member.id}');">
                            <img src="${member.user.avatarUrl}" class="avatar-md img-rounded"
                                 title="${member.user.nickname}">
                        </a>
                    </div>
                    <!--@}-->
                </div>
                <!--@}-->
            </div>
            <!-- col-md-9 -->
        </div>


</#cenluan>